﻿using System;
using System.ComponentModel;
using System.Windows.Forms;

namespace UtfprLibrary.Windows.Forms.ComponentModel {
    /// <summary>
    /// TODO
    /// </summary>
    [Serializable()]
    [TypeConverter("UtfprLibrary.Windows.Forms.ComponentModel.UtfprInitialValuedControlConverter, UtfprLibrary.WindowsForms.Design")]
    public class UtfprInitialValuedControl {
        private Control _control;
        /// <summary>
        /// TODO
        /// </summary>
        [Browsable(false)]
        public Control Control {
            get { return _control; }
            set { _control = value; }
        }

        private object _initialValue;
        /// <summary>
        /// TODO
        /// </summary>
        [Category("Behavior")]
        [Description("The base value for validation. Default is null.")]
        public object InitialValue {
            get { return _initialValue; }
            set { _initialValue = value; }
        }

        /// <summary>
        /// TODO
        /// </summary>
        public UtfprInitialValuedControl() { }

        /// <summary>
        /// TODO
        /// </summary>
        /// <param name="control"></param>
        /// <param name="error"></param>
        /// <param name="initialValue"></param>
        public UtfprInitialValuedControl(Control control, object initialValue) {
            this._control = control;
            this._initialValue = initialValue;
        }

        /// <summary>
        /// TODO
        /// </summary>
        /// <returns></returns>
        public override string ToString() {
            return this.Control.Name;
        }
    }
}
